package Dome2;

public class Shape {
    public void draw(){
        System.out.println("图形");
    }

}
class Rect extends Shape{
    @Override
    public void draw() {
        System.out.println("矩形");
    }
}

class Cycle extends Shape{
    @Override
    public void draw() {
        System.out.println("圆");
    }
}

class Flower extends Shape{
    @Override
    public void draw() {
        System.out.println("花");
    }
}
class Text2{
    public static void main(String[] args) {
        Shape shape[]={new Cycle(),new Rect(),new Flower()};
        for(Shape shape1:shape){
            shape1.draw();
        }
    }
}